package com.atguigu.boot.controller;

import com.atguigu.boot.bean.Car;
import com.atguigu.boot.bean.Person;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: LDeng
 * @Date: 2021-07-09 11:48
 */

//@ResponseBody
//@Controller

@Slf4j
@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String handle01(){
        log.debug("请求进来了");
        return "Hello,Springboot 2!";
    }

    @Autowired
    Car car;

    @RequestMapping("/car1")
    public Car car(){
        return car;
    }

    @Autowired
    Person person;

    @RequestMapping("/person")
    public Person person(){
        return person;
    }
}
